home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / textview.zip / TEXTVIEW.H < prev    next >
Text File  |  1991-06-13  |  4KB  |  92 lines

  1. /*****************************************************************************
  2.  
  3.     textview.h
  4.     ----------
  5.  
  6.     This contains function prototypes and other items needed for users of
  7.     the TextView DLL
  8.  
  9. *****************************************************************************/
  10.  
  11. /* Various typedefs that can be used by applications */
  12.  
  13. typedef    struct    sTVWSTATUS                /* TextView window status block */
  14.         {
  15.             DWORD    dwFlags;                /* dwFlags used in TVCreateWindow */
  16.             int        nMaxLines;                /* max number of lines allowed */
  17.             int        nLinesStored;            /* number of lines stored */
  18.             BOOL    nSuspended;                /* window suspended? */
  19.             BOOL    nReturningData;            /* window in TVReturnData? */
  20.             BOOL    nRedraw;                /* is redrawing allowed? */
  21.             int        nScrollState;            /* scrolling state */
  22.             int        nTabSize;                /* tab size in characters */
  23.             int        nMessagesLost;            /* messages lost in manual scroll */
  24.             int        nRows;                    /* current depth of window in rows */
  25.             int        nColumns;                /* current width in average chars */
  26.             int        nTopLine;                /* number of line at top of window */
  27.             int        nNextRow;                /* number of next free row */
  28.             COLORREF    crColor;            /* currently selected text colour */
  29.             COLORREF    crBkColor;            /* currently selected background color */
  30.         } TVWSTATUS;
  31.  
  32. typedef    TVWSTATUS    FAR * LPTVWSTATUS;
  33.  
  34. /* Routines in the TextView DLL that can be called by an application */
  35.  
  36. HWND    FAR    PASCAL    TVCreateWindow(LPSTR,LPSTR,int,int,int,int,HANDLE,HFONT,
  37.                                    DWORD,DWORD,int,int,FARPROC);
  38. BOOL    FAR    PASCAL    TVDestroyWindow(HWND);
  39. HWND    FAR    PASCAL    TVFindWindow(LPSTR);
  40. BOOL    FAR    PASCAL    TVGetWindowStatus(HWND,LPTVWSTATUS);
  41. BOOL    FAR    PASCAL    TVOutputText(HWND,LPSTR,int);
  42. int        FAR    PASCAL    TVReturnData(HWND,LPSTR,int,FARPROC);
  43. BOOL    FAR    PASCAL    TVRegisterClass(HANDLE,LPSTR,HICON,HBRUSH);
  44. BOOL    FAR    PASCAL    TVResetWindow(HWND);
  45. BOOL    FAR    PASCAL    TVSaveToFile(HWND,int,int,int,DWORD);
  46. DWORD    FAR    PASCAL    TVSetBkColor(HWND,COLORREF);
  47. DWORD    FAR    PASCAL    TVSetTextColor(HWND,COLORREF);
  48. int        FAR    PASCAL    TVSetRedraw(HWND,BOOL);
  49. BOOL    FAR PASCAL    TVSetVPosition(HWND,int);
  50. BOOL    FAR    PASCAL    TVSuspendWindow(HWND,BOOL);
  51. WORD    FAR    PASCAL    TVSetScrollState(HWND,WORD);
  52. void    FAR    PASCAL    TVVersion(LPINT,LPINT,LPINT);
  53.  
  54. /* Flags for the dwStyle argument to TVCreateWindow */
  55.  
  56. #define    TVS_TIMESTAMP    0x00000001L        /* timestamp all messages */
  57. #define    TVS_MINIMIZE    0x00000002L        /* window has a minimize box */
  58. #define    TVS_MAXIMIZE    0x00000004L        /* window has a maximize box */
  59. #define    TVS_NOCLOSE        0x00000008L        /* disable close in system menu */
  60. #define    TVS_NORESIZE    0x00000010L        /* don't give window a resizing border */
  61. #define    TVS_SYSMENU        0x00000020L        /* window has a system menu */
  62. #define    TVS_FILESAVE    0x00000040L        /* window has 'File save' menu item */
  63. #define    TVS_FILESAVEAS    0x00000080L        /* window has 'File save as' menu item */
  64. #define    TVS_FILEPRINT    0x00000100L        /* window has 'File Print' menu items */
  65. #define    TVS_HSCROLL        0x00000200L        /* window can be scrolled horizontally */
  66. #define    TVS_VSCROLL        0x00000400L        /* window can be scrolled vertically */
  67. #define    TVS_SCROLLMENU    0x00000800L        /* window has 'Scrolling' menu */
  68.  
  69. /* Values for the nState argument to TVSetScrollState and replies from
  70. *  TVGetScrollState
  71. */
  72.  
  73. #define    TV_SCR_MANUAL    0x0001            /* manual - scroll bars visible */
  74. #define    TV_SCR_AUTO        0x0002            /* auto - no scroll bars visible */
  75.  
  76. /* Values for the nPosition argument to TVSetVposition */
  77.  
  78. #define    TVSP_START        -1                /* top of scroll range */
  79. #define    TVSP_END        -2                /* bottom of scroll range */
  80.  
  81. /* Menu identifier values passed back in the nMenuItem word of the menu handler
  82. *  call back function declared to TVCreateWindow
  83. */
  84.  
  85. #define    TVMI_CLOSE            1            /* 'System Close' clicked */
  86. #define    TVMI_FILESAVE        16            /* 'File save' clicked */
  87. #define    TVMI_FILESAVEAS        17            /* 'File save as' clicked */
  88. #define    TVMI_FILEPRINT        18            /* 'File print' clicked */
  89. #define    TVMI_AUTOSCROLL        32            /* 'Scroll auto' clicked */
  90. #define    TVMI_MANUALSCROLL    33            /* 'Scroll manual' clicked */
  91.  
  92.